package io.zcoder.innoway.models;


import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import io.zcoder.innoway.utils.Utils;

public class Dashboard implements Parcelable {
    @SerializedName("profile_id")
    int id;
    @SerializedName("weight")
    float weight;
    @SerializedName("bmi")
    float bmi;
    @SerializedName("body_fat")
    float body_fat;
    @SerializedName("muscle")
    float muscle;
    @SerializedName("protein")
    float protein;
    @SerializedName("water")
    float water;
    @SerializedName("visceral_fat")
    float visceral_fat;
    @SerializedName("bone_mass")
    float bone_mass;
    @SerializedName("bmr")
    float bmr;
    @SerializedName("fitness_age")
    float fitness_age;
    @SerializedName("saved_time")
    String saved_time;

    public Dashboard() {

    }

    protected Dashboard(Parcel in) {
        id = in.readInt();
        weight = in.readFloat();
        bmi = in.readFloat();
        body_fat = in.readFloat();
        muscle = in.readFloat();
        protein = in.readFloat();
        water = in.readFloat();
        visceral_fat = in.readFloat();
        bone_mass = in.readFloat();
        bmr = in.readFloat();
        fitness_age = in.readFloat();
        saved_time = in.readString();
    }

    public static final Creator<Dashboard> CREATOR = new Creator<Dashboard>() {
        @Override
        public Dashboard createFromParcel(Parcel in) {
            return new Dashboard(in);
        }

        @Override
        public Dashboard[] newArray(int size) {
            return new Dashboard[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public float getWeight() {
        return weight;
    }

    public float getWeight(int unit) {
        float f = weight * Utils.getRatioWeight(unit);
        return Utils.formatFloat(f);
    }

    public String getWeightWithUnit(int unit) {
        return getWeight(unit) + Utils.getUnitWeight(unit);
    }

    public void setWeight(float weight) {
        this.weight = weight;
    }

    public float getBmi() {
        return bmi;
    }

    public void setBmi(float bmi) {
        this.bmi = bmi;
    }

    public float getBody_fat() {
        return body_fat;
    }

    public void setBody_fat(float body_fat) {
        this.body_fat = body_fat;
    }

    public float getMuscle() {
        return muscle;
    }

    public void setMuscle(float muscle) {
        this.muscle = muscle;
    }

    public float getProtein() {
        return protein;
    }

    public void setProtein(float protein) {
        this.protein = protein;
    }

    public float getWater() {
        return water;
    }

    public void setWater(float water) {
        this.water = water;
    }

    public float getVisceral_fat() {
        return visceral_fat;
    }

    public void setVisceral_fat(float visceral_fat) {
        this.visceral_fat = visceral_fat;
    }

    public float getBone_mass() {
        return bone_mass;
    }

    public void setBone_mass(float bone_mass) {
        this.bone_mass = bone_mass;
    }

    public float getBmr() {
        return bmr;
    }

    public void setBmr(float bmr) {
        this.bmr = bmr;
    }

    public float getFitness_age() {
        return fitness_age;
    }

    public void setFitness_age(float fitness_age) {
        this.fitness_age = fitness_age;
    }

    public String getSaved_time() {
        return saved_time;
    }

    public void setSaved_time(String saved_time) {
        this.saved_time = saved_time;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeFloat(weight);
        dest.writeFloat(bmi);
        dest.writeFloat(body_fat);
        dest.writeFloat(muscle);
        dest.writeFloat(protein);
        dest.writeFloat(water);
        dest.writeFloat(visceral_fat);
        dest.writeFloat(bone_mass);
        dest.writeFloat(bmr);
        dest.writeFloat(fitness_age);
        dest.writeString(saved_time);
    }
}
